const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
    transpileDependencies: true,
    devServer: {
        open: true,
        host: "127.0.0.1",
        port: "8888",
        proxy: {
            //每一个键就是请求要携带的前缀
            "/dev-api1": {
                //目标服务器地址
                target: "http://gmall-h5-api.atguigu.cn",
                //在请求时是否去掉添加的代理前缀
                pathRewrite: {
                    "^/dev-api1": "",
                },
                //伪装自己的地址
                changeOrigin: true,
            },
        },
    },
    configureWebpack: {
        resolve: {
            alias: {
                "@assets": "@/assets",
                "@comp": "@/comp",
                "@utils": "@/utils",
                "@pages": "@/pages",
            },
        },
    },
});
